/**
 * Copyright &copy; 2012-2014 <a href="https://github.com/thinkgem/jeesite">JeeSite</a> All rights reserved.
 */
package com.thinkgem.jeesite.modules.cms.entity;

import com.thinkgem.jeesite.modules.sys.entity.User;
import org.hibernate.validator.constraints.Length;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;

import com.thinkgem.jeesite.common.persistence.DataEntity;

import javax.validation.constraints.NotNull;

/**
 * 图片新闻Entity
 * @author 夏国强
 * @version 2016-05-25
 */
public class ExImage extends DataEntity<ExImage> {
	
	private static final long serialVersionUID = 1L;
    private Category category;// 栏目编号
	private String title;		// 图片名称
	private String color;		// 标题颜色
	private String image;		// 链接图片
	private String href;		// 链接地址
	private Integer weight;		// 权重
	private Date weightDate;		// 权重期限
	private String content;		// 新闻内容
	private String images;		// 图集

    private User user;

    public User getUser() {
        return user;
    }

    public void setUser(User user) {
        this.user = user;
    }
	
	public ExImage() {
		super();
		this.weight = 0;
	}

	public ExImage(String id){
		super(id);
	}

//	@Length(min=1, max=64, message="栏目编号长度必须介于 1 和 64 之间")
//	public String getCategoryId() {
//		return categoryId;
//	}

//	public void setCategoryId(String categoryId) {
//		this.categoryId = categoryId;
////	}

    public ExImage(Category category){
        this();
        this.category = category;
    }

    public Category getCategory() {
        return category;
    }

    public void setCategory(Category category) {
        this.category = category;
    }
	
	@Length(min=1, max=255, message="图片名称长度必须介于 1 和 255 之间")
	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}
	
	@Length(min=0, max=50, message="标题颜色长度必须介于 0 和 50 之间")
	public String getColor() {
		return color;
	}

	public void setColor(String color) {
		this.color = color;
	}
	
	@Length(min=1, max=255, message="链接图片长度必须介于 1 和 255 之间")
	public String getImage() {
		return image;
	}

	public void setImage(String image) {
		this.image = image;
	}
	
	@Length(min=0, max=255, message="链接地址长度必须介于 0 和 255 之间")
	public String getHref() {
		return href;
	}

	public void setHref(String href) {
		this.href = href;
	}

	@NotNull
	public Integer getWeight() {
		return weight;
	}

	public void setWeight(Integer weight) {
		this.weight = weight;
	}

	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	public Date getWeightDate() {
		return weightDate;
	}

	public void setWeightDate(Date weightDate) {
		this.weightDate = weightDate;
	}
	
	@Length(min=1, max=255, message="新闻内容长度必须介于 1 和 255 之间")
	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}
	
	@Length(min=1, max=6500, message="图集长度必须介于 1 和 6500 之间")
	public String getImages() {
		return images;
	}

	public void setImages(String images) {
		this.images = images;
	}
	
}